<?php
/**
 * @filesource						BookRequestModel.class.php
 * @desc 							预订单模型类
 * 
 * @author							houyining
 * @copyright						hou.yining@gmail.com
 * @date							2011-05-10
 */

class BookRequestModel extends CommonModel{
	//根据预订单id获取预订单详细信息
	public function getBookRequestById($id){
		$rs = $this->db->query("select a.name as customer_name, b.* from ".
								$this->tablePrefix."book_request as b,".
								$this->tablePrefix."general_customer as a ".
								"where b.id=".$id . " and a.id=b.charge_person_id");
		return $rs;
	}

	//根据主办人id得到所有预订单信息
	public function getBookRequestByChargePerson($charge_person_id){
		return $this->where(array('charge_person_id' => $charge_person_id))->select();
	}
	
	//根据申请人id得到所有的预订单信息
	public function getBookRequestByApplicant($applicant_id){
		return $this->where(array('applicant_id' => $applicant_id))->select();
	}
}
?>